// pages/profile/profile.js
const db = wx.cloud.database()
let app=getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    unreadNum:0,
    userInfo:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    app.setCallBack("profileUnRead",this.profileSetUnreadNum,this)
    this.setData({userInfo : app.globalData.userInfo})
  },

  profileSetUnreadNum(unreadNum,that){
    that.setData({unreadNum:unreadNum})
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getTabBar().init()
  },
  async onClickUserInfo() {
    wx.navigateTo({url: `../profile-edit/profile-edit`})
  }
})